<html>
	<head>
		<title>selection test</title>
	</head>
	<body>
		<div>
			Input: <textarea id="test"></textarea>
		</div>
		<div>
			Output: <span id="output">xxx</span>
		</div>
		
		<script src="jquery-1.3.2.js"></script>
		<script src="selection.js"></script>
		<script>
			$("#test").bind("keyup keypress click", function() {
				var selection = $(this).selection();
				$("#output").text(selection.start + " - " + selection.end);
			});
		</script>
	</body>
</html>